import React from 'react';
// 高阶组件 formProvider表单验证
import iiHoc from '../hoc/iiHoc';
import {ThemeContext} from '../../context/theme-context';
// 添加用户组件
class High extends React.Component{

    static contextType = ThemeContext;
    constructor(props){
        super(props)
        this.handleSubmit=this.handleSubmit.bind(this)
        this.state={
            name:'我是一个高阶组件'
        }
    }
    handleSubmit(){
        console.log(this.props.form)
    }
    render() {
        return(
            <div>
                我是高阶组件反向继承{this.context}
                <ThemeContext.Consumer>
                    {context=>(
                        <h1>{context}</h1>
                    )}
                </ThemeContext.Consumer>
            </div>
        )
    }
}

export default iiHoc(High);